import {
	request
} from "@/utils/request.js"





/*
注册

*/
//用户通过微信注册/登录
export const api_custom_login = (params) => {
	return request({
		url: "/custom/wxLogin",
		method: "POST",
		data: params
	});
};

//员工通过微信注册/登录
export const api_employee_login = (params) => {
	return request({
		url: "/employee/wxLogin",
		method: "POST",
		data: params
	});
};



/*
saleOrder
*/
//开单
export const api_saleOrder_add = (params) => {
	return request({
		url: "/saleOrder/add",
		method: "POST",
		data: params
	});
}

//修改初始订单
export const api_saleOrder_update = (params) => {
	return request({
		url: "/saleOrder/update",
		method: "POST",
		data: params
	});
}

//查询订单简易信息
export const api_get_order_easy_info = (params) => {
	return request({
		url: "/saleOrder/getOrderEasyInfo",
		data: params
	});
}

//删除订单
export const api_saleOrder_delete = (params) => {
	return request({
		url: "/saleOrder/delete",
		method: "POST",
		data: params
	});
}

//分页获取订单列表
export const api_saleOrder_page = (params) => {
	return request({
		url: "/saleOrder/page",
		data: params
	});
}

//获取订单列表
export const api_saleOrder_list = (params) => {
	return request({
		url: "/saleOrder/list",
		data: params
	});
}

//查询订单信息
export const api_saleOrder_getInfo = (params) => {
	return request({
		url: "/saleOrder/getSaleOrderInfo",
		data: params
	});
}

//设置主管
export const api_saleOrder_setManager = (params) => {
	return request({
		url: "/saleOrder/setManager",
		method: "POST",
		data: params
	});
}

//修改订单施工状态
export const api_saleOrder_updateBuildStatus = (params) => {
	return request({
		url: "/saleOrder/updateBuildStatus",
		method: "POST",
		data: params
	});
}

//修改订单支付状态
export const api_saleOrder_updateOrderStatus = (params) => {
	return request({
		url: "/saleOrder/updateOrderStatus",
		method: "POST",
		data: params
	});
}

//获取销售订单信息
export const api_saleOrder_getSaleOrderInfo = (params) => {
	return request({
		url: "/saleOrder/getSaleOrderInfo",
		data: params
	});
}



/*businessType*/
//获取渠道
export const api_businessType_list = (params) => {
	return request({
		url: "/businessType/list",
		data: params
	});
}




/*
serviceItem
*/
//给订单上传所选服务
export const api_serviceItem_add = (params) => {
	return request({
		url: "/serviceItem/add",
		method: "POST",
		data: params
	});
}

//删除订单选择的某项服务
export const api_serviceItem_delete = (params) => {
	return request({
		url: "/serviceItem/delete",
		method: "POST",
		data: params
	});
}

//服务项目改价
export const api_serviceItem_update = (params) => {
	return request({
		url: "/serviceItem/update",
		method: "POST",
		data: params
	});
}

//查询所选服务详情
export const api_serviceItem_list = (params) => {
	return request({
		url: "/serviceItem/list",
		data: params
	});
}

//评分
export const api_serviceItem_checkServiceItem = (params) => {
	return request({
		url: "/serviceItem/checkServiceItem",
		method: "POST",
		data: params
	});
}

//驳回服务
export const api_serviceItem_handelServiceItem = (params) => {
	return request({
		url: "/serviceItem/handelServiceItem",
		// method: "POST",
		data: params
	});
}



/*orderSettlement*/
//设置订单支付状态
export const api_orderSettlement_add = (params) => {
	return request({
		url: "/orderSettlement/add",
		data: params
	});
}

//修改订单支付状态
export const api_orderSettlement_update = (params) => {
	return request({
		url: "/orderSettlement/update ",
		data: params,
		method: "POST",
	});
}



/*payType*/
//获取支付方式列表
export const api_payType_list = (params) => {
	return request({
		url: "/payType/list",
		data: params
	});
}



/*
settlementItem
*/
//记录订单支付情况
export const api_settlementItem_add = (params) => {
	return request({
		url: "/settlementItem/add",
		method: "POST",
		data: params
	});
}

//获取利润
export const api_settlementItem_getProfit = () => {
	return request({
		url: "/settlementItem/getProfit",
	});
}



/*
productSku
*/
/*修改订单产品价格*/
export const api_productSku_update = (params) => {
	return request({
		url: "/productSku/update",
		method: "POST",
		data: params
	});
}




/*
orderService
*/
//上传选择的服务 预
export const api_orderService_add = (params) => {
	return request({
		url: "/orderService/add",
		method: "POST",
		data: params
	});
}

//上传施工检查照
export const api_orderService_uploadCheckImage = (params) => {
	return request({
		url: "/orderService/uploadCheckImage",
		method: "POST",
		data: params
	});
}

//上传施工保护照
export const api_orderService_uploadProtectImage = (params) => {
	return request({
		url: "/orderService/uploadProtectImage",
		method: "POST",
		data: params
	});
}

//上传施工完成照
export const api_orderService_uploadCompleteImage = (params) => {
	return request({
		url: "/orderService/uploadCompleteImage",
		method: "POST",
		data: params
	});
}



/*
serviceCategory
*/
//获取服务分类
export const api_serviceCategory_get_by_service = () => {
	return request({
		url: "/serviceCategory/getServiceCategoryListByService",
	});
}

//通过服务获取产品分类
export const api_productCategory_get_by_product = (params) => {
	return request({
		url: "/serviceCategory/getServiceCategoryListByProduct",
		data: params
	});
}



/*product*/
//分页获取产品列表
export const api_product_page = (params) => {
	return request({
		url: "/product/page",
		data: params
	});
}

//查产品信息
export const api_product_infoById = (params) => {
	return request({
		url: "/product/infoById",
		data: params
	});
}

//通过一维码查产品信息
export const api_product_getByBarCode = (params) => {
	return request({
		url: "/product/getByBarCode",
		data: params
	});
}

//添加产品库存
export const api_product_addProductNum = (params) => {
	return request({
		url: "/product/addProductNum",
		data: params,
		method: 'POST',
	});
}

//产品出库一次（减库存）
export const api_product_adminReduceStorage = (params) => {
	return request({
		url: "/product/adminReduceStorage",
		data: params,
		method: 'POST',
	});
}



/*supplier*/
//查询供应商
export const api_supplier_list = (params) => {
	return request({
		url: "/supplier/list",
		data: params
	});
}




/*productSku*/
//给订单服务绑定产品sku
export const api_productSku_add = (params) => {
	return request({
		url: "/productSku/add",
		data: params,
		method: "POST"
	});
}




/*
employee*/
//查询员工列表
export const api_employee_list = (params) => {
	return request({
		url: "/employee/list",
		data: params
	});
}


/**
 * serviceEmployee
 */
//给订单服务选择师傅(不是服务项目,而是服务容器)
export const api_serviceEmployee_add = (params) => {
	return request({
		url: "/serviceEmployee/add",
		method: "POST",
		data: params
	});
}

//获取订单安排的师傅列表
export const api_serviceEmployee_list = (params) => {
	return request({
		url: "/serviceEmployee/list",
		data: params
	});
}

//师傅选择服务去做
export const api_serviceEmployee_receiveService = (params) => {
	return request({
		url: "/serviceEmployee/receiveService",
		method: "POST",
		data: params
	});
}

//查询师傅选了哪些服务项目
export const api_serviceEmployee_getServiceByEmployeeId = (params) => {
	return request({
		url: "/serviceEmployee/getServiceByEmployeeId",
		data: params
	});
}

//师傅完成项目
export const api_serviceEmployee_completeServiceItem = (params) => {
	return request({
		url: "/serviceEmployee/completeServiceItem",
		method: "POST",
		data: params
	});
}




/*
用户
*/
//查询用户
export const api_get_custom_by_id = (params) => {
	return request({
		url: "/custom/getByCustomId",
		data: params
	});
}